import static org.junit.Assert.assertEquals;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class WeatherTest {
    private Weather weather;
    
	@Before
	public void setUp() {
	    weather = new Weather("Weather in San Francisco", "limited", 4, "San Francisco",
	    		              "44", "77", "61", 72, "201406220900", "SSW at 3mph", "0");
	}
	
	@Test
	public void testInitValues() {
		System.out.format("Testing init values.%n");
		assertEquals("Weather in San Francisco", weather.getDescription());
		assertEquals("limited", weather.getVisibility());
		assertEquals(4, weather.getIconNo());
		assertEquals("San Francisco", weather.getLocation());
		assertEquals("44", weather.getDewpoint());
		assertEquals("77", weather.getFeelsLikeTemp());
		assertEquals("61", weather.getHumidity());
		assertEquals(72, weather.getTemperature());
		assertEquals("201406220900", weather.getLastUpdated());
		assertEquals("SSW at 3mph", weather.getWindSpeed());
		assertEquals("0", weather.getPrecipitation());
	}
	
	@Test
	public void testHighWinds() {
		System.out.format("Testing high winds.%n");
		int weather_affect;
		weather.setWindSpeed("SW at 40mph");
		weather_affect = weather.computeWeatherAffect();
		assertEquals(weather_affect, 2);
	}
}
